# Variables
set $meta Mod4

# Move floating windows with [META] + mouse 1 and resize with [META] + mouse 2
floating_modifier $meta normal

# Shortcuts for important applications
bindsym $meta+t     exec $term
bindsym $meta+b     exec $browser
bindsym $meta+Enter exec $menu
bindsym $meta+s     exec $screenshot

bindsym $meta+r      reload # Reloads sway config
bindsym $meta+Escape exec $lock # Lock system
bindsym $meta+Delete kill bindsym # Kills selected window

# Notification control
bindsym $meta+d         exec makoctl dismiss
bindsym Control+$meta+d exec makoctl dismiss --all

# Media and audio control
bindsym --locked XF86AudioRaiseVolume exec --no-startup-id pamixer -i 5 # Look into amixer
bindsym --locked XF86AudioLowerVolume exec --no-startup-id pamixer -d 5
bindsym --locked XF86AudioMute        exec --no-startup-id pamixer -t
bindsym --locked XF86AudioNext        exec playerctl next
bindsym --locked XF86AudioPrev        exec playerctl previous
bindsym --locked XF86AudioPlay        exec playerctl play-pause

# Brightness controls
bindsym --locked XF86MonBrightnessUp   exec light -S "$(light -G | awk '{ print int(($1 + .72) * 1.4) }')" # Make this a variable
bindsym --locked XF86MonBrightnessDown exec light -S "$(light -G | awk '{ print int($1 / 1.4) }')"

# Move your focus around
bindsym $meta+Up    focus up
bindsym $meta+Left  focus left
bindsym $meta+Down  focus down
bindsym $meta+Right focus right
# Same but with vim like binds
bindsym $meta+k focus up
bindsym $meta+h focus left
bindsym $meta+j focus down
bindsym $meta+l focus right

# Move the focused window with the same, but add Alt
bindsym $meta+Shift+Up move up
bindsym $meta+Shift+Left move left
bindsym $meta+Shift+Down move down
bindsym $meta+Shift+Right move right
# Same but with vim like binds
bindsym $meta+Shift+k move up
bindsym $meta+Shift+h move left
bindsym $meta+Shift+j move down
bindsym $meta+Shift+l move right

# switch to workspace
bindsym $meta+1 workspace $ws1
bindsym $meta+2 workspace $ws2
bindsym $meta+3 workspace $ws3
bindsym $meta+4 workspace $ws4
bindsym $meta+5 workspace $ws5
bindsym $meta+6 workspace $ws6
bindsym $meta+7 workspace $ws7
bindsym $meta+8 workspace $ws8
bindsym $meta+9 workspace $ws9
bindsym $meta+0 workspace $ws10

# move focused container to workspace
bindsym $meta+Shift+1 move container to workspace $ws1
bindsym $meta+Shift+2 move container to workspace $ws2
bindsym $meta+Shift+3 move container to workspace $ws3
bindsym $meta+Shift+4 move container to workspace $ws4
bindsym $meta+Shift+5 move container to workspace $ws5
bindsym $meta+Shift+6 move container to workspace $ws6
bindsym $meta+Shift+7 move container to workspace $ws7
bindsym $meta+Shift+8 move container to workspace $ws8
bindsym $meta+Shift+9 move container to workspace $ws9
bindsym $meta+Shift+0 move container to workspace $ws10

# Switch the current workspace between different layout styles
# TODO: Fix these and look for more options
#bindsym $mod+o layout stacking
#bindsym $mod+p layout toggle split

# Make the current focus fullscreen
bindsym $meta+f fullscreen

# Toggle the current focus between tiling and floating mode
bindsym $meta+space floating toggle

# Swap focus between the tiling area and the floating area
bindsym $meta+Alt+space focus mode_toggle

# move focus to the parent window
bindsym $meta+p focus parent

# Modes
mode "resize" {
    bindsym Left resize shrink width 25px
    bindsym Up resize shrink height 25px
    bindsym Down resize grow height 25px
    bindsym Right resize grow width 25px

    # return to default mode
    bindsym Return mode "default"
    bindsym Escape mode "default"
}
bindsym F1 mode "resize"
